/*
 * DataOutputExceptionException.java
 * 
 * Created on 05-Jan-2008, 10:48:32
 * 
 * Copyright (C)
 *
 * This program is free software; you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by the Free Software
 * Foundation; either version 2 of the License, or (at your option) any later
 * version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
 * details.
 *
 * You should have received a copy of the GNU General Public License along with
 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
 * Place, Suite 330, Boston, MA 02111-1307 USA
 */

package com.grubby.databean.exception;

/**
 * This is an exception class to wrap in a user-freindly way, any exceptions
 * which may occur during data bean output.
 * @author A. HARMEL-LAW. E: andrew.harmel.law@gmail.com
 */
public class DataOutputException extends Exception {

    // TODO: Copy the implementation of this from my Struts book

    private Exception wrappedException;
    
    /**
     * Creates a new instance of <code>DataOutputException</code> without detail message.
     */
    public DataOutputException() {
        super();
    }

    /**
     * Constructs an instance of <code>DataOutputException</code> with the specified detail message.
     * @param msg The detail message.
     */
    public DataOutputException(String msg) {
        super(msg);
    }
    
    /**
     * Constructs an instance of <code>DataOutputException</code> with the specified detail message and wrapped exception.
     * @param msg The detail message.
     * @param ex The wrapped exception
     */
    public DataOutputException(String msg, Exception ex) {
        super(msg);
        this.setWrappedException(ex);
    }

    /**
     * Gets the wrapped Exception
     * @return The wrapped Exception
     */
    public Exception getWrappedException() {
        return wrappedException;
    }

    /**
     * Sets the wrapped Exception
     * @param wrappedException The wrapped Exception
     */
    protected void setWrappedException(Exception wrappedException) {
        this.wrappedException = wrappedException;
    }
}
